# 导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep, strftime

driver = webdriver.Firefox()
driver.maximize_window()
url = 'file:///C:/Users/tedu/Desktop/NSD2407/html/register.html'
driver.get(url)

driver.find_element(By.CSS_SELECTOR, '#user').send_keys('CCC')
# 截屏，后缀名通常是png
# 2024_12_25_11_24_30
driver.get_screenshot_as_file(f'img/{strftime("%Y_%m_%d_%H_%M_%S")}.png')


sleep(3)
driver.quit()